#include<stdio.h>
#include<unistd.h>

int main()
{
  pid_t id=fork();
  if(id==0)
  {
    while(1)
    {
      printf("child:pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(2);
    }
  }
  else{
    while(1)
    {
      printf("father:pid:%d,ppid:%d\n",getpid(),getppid());
      sleep(2);
    }
  }

  system("pause");
}
